// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: {enabled: true},
  imports: {
    dirs: ['apis', 'utils']
  },
  app: {
    head: {
      title: "学相伴",
      titleTemplate:"%s-为每个想学习编程的人提供一个少走弯路的平台",
      charset: "utf-8",
      htmlAttrs: {
        lang: "zh-cn",
      },
      link: [
        {rel: 'stylesheet', href: '/fonts/iconfont.css'},
        {rel: 'stylesheet', href: '/css/animate.css'}
      ]
    },
    pageTransition: {
      name: 'fade',
      mode: 'out-in' // 默认值
    }
  },
  modules: [
    ['@pinia/nuxt', {
      autoImports: ['defineStore']
    }],
    '@element-plus/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
  ],
  elementPlus: {
    icon:true
  },
  css: [
    '@/assets/css/main.css'
  ],
  vite: {
    esbuild: {
      drop: process.env.NODE_ENV === 'production' ? ['console', 'debugger'] : []
    },
    build: {
      minify: 'esbuild',
      chunkSizeWarningLimit: 1024,
      cssCodeSplit: true
    },
  },
  nitro: {
    // 缩小捆绑包
    minify: true,
    // 关闭源映射生成
    sourceMap: false,
  }
})
